<HTML>
<HEAD>
<TITLE>g_energy</TITLE>
<LINK rel=stylesheet href="style.css" type="text/css">
<BODY text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#990000" alink="#FF0000">
<TABLE WIDTH="98%" NOBORDER >
<TR><TD WIDTH=400>
<TABLE WIDTH=400 NOBORDER>
<TD WIDTH=116>
<a href="http://www.gromacs.org/"><img SRC="../images/gmxlogo_small.png"BORDER=0 </a></td>
<td ALIGN=LEFT VALIGN=TOP WIDTH=280><br><h2>g_energy</h2><font size=-1><A HREF="../online.html">Main Table of Contents</A></font><br><br></td>
</TABLE></TD><TD WIDTH="*" ALIGN=RIGHT VALIGN=BOTTOM><p><B>VERSION 4.5<br>
Thu 26 Aug 2010</B></td></tr></TABLE>
<HR>
<H3>Description</H3>
<p>
g_energy extracts energy components or distance restraint
data from an energy file. The user is prompted to interactively
select the energy terms she wants.<p>
Average, RMSD and drift are calculated with full precision from the
simulation (see printed manual). Drift is calculated by performing
a LSQ fit of the data to a straight line. The reported total drift
is the difference of the fit at the first and last point.
An error estimate of the average is given based on a block averages
over 5 blocks using the full precision averages. The error estimate
can be performed over multiple block lengths with the options
<tt>-nbmin</tt> and <tt>-nbmax</tt>.
Note that in most cases the energy files contains averages over all
MD steps, or over many more points than the number of frames in
energy file. This makes the g_energy statistics output more accurate
than the <a href="xvg.html">xvg</a> output. When exact averages are not present in the energy
file the statistics mentioned above is simply over the single, per-frame
energy values.<p>
The term fluctuation gives the RMSD around the LSQ fit.<p>
Some fluctuation-dependent properties can be calculated provided
the correct energy terms are selected. The following properties
will be computed:<br>
Property                        Energy terms needed<br>
---------------------------------------------------<br>
Heat capacity Cp (NPT sims):    Enthalpy, Temp     <br>
Heat capacity Cv (NVT sims):    Etot, Temp         <br>
Thermal expansion coeff. (NPT): Enthalpy, Vol, Temp<br>
Isothermal compressibility:     Vol, Temp          <br>
Adiabatic bulk modulus:         Vol, Temp          <br>
---------------------------------------------------<br>
You always need to set the number of molecules <tt>-nmol</tt>, and,
if you used constraints in your simulations you will need to give
the number of constraints per molecule <tt>-nconstr</tt> in order to
correct for this: (nconstr/2) kB is subtracted from the heat
capacity in this case. For instance in the case of rigid water
you need to give the value 3 to this option.<p>
When the <tt>-viol</tt> option is set, the time averaged
violations are plotted and the running time-averaged and
instantaneous sum of violations are recalculated. Additionally
running time-averaged and instantaneous distances between
selected pairs can be plotted with the <tt>-pairs</tt> option.<p>
Options <tt>-ora</tt>, <tt>-ort</tt>, <tt>-oda</tt>, <tt>-odr</tt> and
<tt>-odt</tt> are used for analyzing orientation restraint data.
The first two options plot the orientation, the last three the
deviations of the orientations from the experimental values.
The options that end on an 'a' plot the average over time
as a function of restraint. The options that end on a 't'
prompt the user for restraint label numbers and plot the data
as a function of time. Option <tt>-odr</tt> plots the RMS
deviation as a function of restraint.
When the run used time or ensemble averaged orientation restraints,
option <tt>-orinst</tt> can be used to analyse the instantaneous,
not ensemble-averaged orientations and deviations instead of
the time and ensemble averages.<p>
Option <tt>-oten</tt> plots the eigenvalues of the molecular order
tensor for each orientation restraint experiment. With option
<tt>-ovec</tt> also the eigenvectors are plotted.<p>
With <tt>-fee</tt> an estimate is calculated for the free-energy
difference with an ideal gas state: <br>
  Delta A = A(N,V,T) - A_idgas(N,V,T) = kT ln &lt; e^(Upot/kT) &gt;<br>
  Delta G = G(N,p,T) - G_idgas(N,p,T) = kT ln &lt; e^(Upot/kT) &gt;<br>
where k is Boltzmann's constant, T is set by <tt>-fetemp</tt> and
the average is over the ensemble (or time in a trajectory).
Note that this is in principle
only correct when averaging over the whole (Boltzmann) ensemble
and using the potential energy. This also allows for an entropy
estimate using:<br>
  Delta S(N,V,T) = S(N,V,T) - S_idgas(N,V,T) = (&lt;Upot&gt; - Delta A)/T<br>
  Delta S(N,p,T) = S(N,p,T) - S_idgas(N,p,T) = (&lt;Upot&gt; + pV - Delta G)/T
<p>
When a second energy file is specified (<tt>-f2</tt>), a free energy
difference is calculated dF = -kT ln &lt; e ^ -(EB-EA)/kT &gt;A ,
where EA and EB are the energies from the first and second energy
files, and the average is over the ensemble A. <b>NOTE</b> that
the energies must both be calculated from the same trajectory.
<P>
<H3>Files</H3>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2>
<TR><TH>option</TH><TH>filename</TH><TH>type</TH><TH>description</TH></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-f</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="edr.html">    ener.edr</a></tt> </TD><TD> Input </TD><TD> Energy file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-f2</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="edr.html">    ener.edr</a></tt> </TD><TD> Input, Opt. </TD><TD> Energy file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-s</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="files.html">   topol.tpr</a></tt> </TD><TD> Input, Opt. </TD><TD> Run input file: <a href="tpr.html">tpr</a> <a href="tpb.html">tpb</a> <a href="tpa.html">tpa</a> </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-o</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">  energy.xvg</a></tt> </TD><TD> Output </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-viol</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">violaver.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-pairs</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">   pairs.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-ora</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html"> orienta.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-ort</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html"> orientt.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-oda</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html"> orideva.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-odr</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html"> oridevr.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-odt</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html"> oridevt.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-oten</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">  oriten.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-corr</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html"> enecorr.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-vis</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">   visco.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-ravg</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">runavgdf.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
</TABLE>
<P>
<H3>Other options</H3>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2>
<TR><TH>option</TH><TH>type</TH><TH>default</TH><TH>description</TH></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]h</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Print help info and quit </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]version</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Print version info and quit </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-nice</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>19</tt> </TD><TD> Set the nicelevel </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-b</tt></b> </TD><TD ALIGN=RIGHT> time </TD><TD ALIGN=RIGHT> <tt>0     </tt> </TD><TD> First frame (ps) to read from trajectory </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-e</tt></b> </TD><TD ALIGN=RIGHT> time </TD><TD ALIGN=RIGHT> <tt>0     </tt> </TD><TD> Last frame (ps) to read from trajectory </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]w</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> View output <a href="xvg.html">xvg</a>, <a href="xpm.html">xpm</a>, <a href="eps.html">eps</a> and <a href="pdb.html">pdb</a> files </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-xvg</tt></b> </TD><TD ALIGN=RIGHT> enum </TD><TD ALIGN=RIGHT> <tt>xmgrace</tt> </TD><TD> <a href="xvg.html">xvg</a> plot formatting: <tt>xmgrace</tt>, <tt>xmgr</tt> or <tt>none</tt> </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]fee</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Do a free energy estimate </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-fetemp</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>300   </tt> </TD><TD> Reference temperature for free energy calculation </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-zero</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>0     </tt> </TD><TD> Subtract a zero-point energy </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]sum</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Sum the energy terms selected rather than display them all </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]dp</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Print energies in high precision </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-nbmin</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>5</tt> </TD><TD> Minimum number of blocks for error estimate </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-nbmax</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>5</tt> </TD><TD> Maximum number of blocks for error estimate </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]mutot</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Compute the total dipole moment from the components </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-skip</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>0</tt> </TD><TD> Skip number of frames between data points </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]aver</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Also print the exact average and rmsd stored in the energy frames (only when 1 term is requested) </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-nmol</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>1</tt> </TD><TD> Number of molecules in your sample: the energies are divided by this number </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-nconstr</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>0</tt> </TD><TD> Number of constraints per molecule. Necessary for calculating the heat capacity </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]fluc</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Calculate autocorrelation of energy fluctuations rather than energy itself </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]orinst</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Analyse instantaneous orientation data </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]ovec</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Also plot the eigenvectors with -oten </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-acflen</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>-1</tt> </TD><TD> Length of the ACF, default is half the number of frames </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]normalize</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>yes   </tt> </TD><TD> Normalize ACF </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-P</tt></b> </TD><TD ALIGN=RIGHT> enum </TD><TD ALIGN=RIGHT> <tt>0</tt> </TD><TD> Order of Legendre polynomial for ACF (0 indicates none): <tt>0</tt>, <tt>1</tt>, <tt>2</tt> or <tt>3</tt> </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-fitfn</tt></b> </TD><TD ALIGN=RIGHT> enum </TD><TD ALIGN=RIGHT> <tt>none</tt> </TD><TD> Fit function: <tt>none</tt>, <tt>exp</tt>, <tt>aexp</tt>, <tt>exp_exp</tt>, <tt>vac</tt>, <tt>exp5</tt>, <tt>exp7</tt> or <tt>exp9</tt> </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-ncskip</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>0</tt> </TD><TD> Skip N points in the output file of correlation functions </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-beginfit</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>0     </tt> </TD><TD> Time where to begin the exponential fit of the correlation function </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-endfit</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>-1    </tt> </TD><TD> Time where to end the exponential fit of the correlation function, -1 is until the end </TD></TD>
</TABLE>
<P>
<hr>
<div ALIGN=RIGHT>
<font size="-1"><a href="http://www.gromacs.org">http://www.gromacs.org</a></font><br>
<font size="-1"><a href="mailto:gromacs@gromacs.org">gromacs@gromacs.org</a></font><br>
</div>
</BODY>
